<#list database.tables as table>
uint32_t ${database.apiName}::Query${table.ddoName}
{
	const CCntlInfo& rCntlInfo,
	const TQuery${table.ddoName}Filter& oFilter;
	std::string& strResultMsg,
	std::vector<T${table.ddoName}Ddo>& oVecQueryResult;
}
{
	uint32_t dwResult = 0;
	c2cent::storage::CMysqlStorage oStorage();
	
	do{
		std::stringstream sql;
		sql << "SELECT * FROM "
		    << CDAL_SET->GetTableName(rCntlInfo.GetCmdId(), s_strRole, oFilter.Get${table.sliceKeyFieldName?cap_first}, wUseSetId); 
		<#-- 检查所有的输入参数  -->
		//todo 实现条件添加
		<#list table.fields as field>
		<#if field.bQuery>
		<#-- boolean isFirstCondition = true;
		if(oFilter.Get${field.fieldName?cap_first}().${field.type.CheckEmpty})
		{
	       if(isFirstCondition)
	        {
	           sql << "WHERE "
	           isFirstCondition = false;
	        }
	       else
	        {
	           sql << "AND "
	        }
			sql << ${field.sqlFieldName} << " = " << oFilter.Get${field.fieldName?cap_first};
		}
		-->
		</#if>
		</#list>
		dwResult = DbHelper::GetRecords(sql.str().c_str(),
                                       oStorage, 
		                                DdoFromDb::${table.ddoName}FromDb,
		                                oVecQueryResult);
		if(dwResult)
		{
		  strResultMsg="查询DB失败";
		  break;
		}
	}while(0);
	std::stringstream filterStream;
	oFilter.DumpData(filterStream);
	SERVICE_LOG(dwResult, "[oFilter={%s}][strResultMsg=%s][resultVecSize=%lu]",
	            filterStream.str().c_str(), strResultMsg.c_str(),
	            (unsigned long)oVecQueryResult.size());
	return dwResult;
}

</#list>